improved printing, added INCLUDE#26
Merged
Zac-HD merged 1 commit intopython-trio:mainfrom Aug 7, 2022
Merged
Conversation
…y promise not to raise
Zac-HD
approved these changes
Aug 7, 2022
Zac-HD
added a commit
that referenced
this pull request
May 1, 2026
* Fix ASYNC200 regression on `foo("x").bar` patterns (#26.4.2)
The canonical-qualname resolver introduced in 26.4.1 recursed through
ast.Call/cst.Call unconditionally, which collapsed nested calls inside an
attribute chain into a dotted name (e.g. `read_session("a").get` resolved
to `read_session.get`). This caused user-configured ASYNC200 patterns
like `*session.get` to flag method calls on the return value of an
unrelated function -- a false positive that did not exist in 25.5.3.
Only unwrap Call at the outermost position; calls inside an attribute
chain now make the whole expression unresolvable (None), since the
target of the trailing attribute is a return value we can't determine
statically. Top-level shapes like `trio.open_nursery()` still resolve
as before.
Adds:
- eval-file regression case in tests/eval_files/async200.py
- direct unit test for resolve_canonical_ast / resolve_canonical_cst
- changelog entry for 26.4.2 and version bump
https://claude.ai/code/session_01BWheK2fZPMDhbfS1LCR2zc
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Satisfy pre-commit: hoist import + black reformat
- Move `resolve_canonical_ast` / `resolve_canonical_cst` import to the top
of tests/test_flake8_async.py (ruff PLC0415 / import-not-at-top).
- Black reformat of `_resolve_attr_chain_ast` signature.
https://claude.ai/code/session_01BWheK2fZPMDhbfS1LCR2zc
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forked off from #17 for a smaller diff